# Make sure it produce net.so instead of libnet.so
add_library(net SHARED netinput.cpp)
target_link_libraries(net PRIVATE Fcitx5::Core Fcitx5::Module::Punctuation  Fcitx5::Module::QuickPhrase ${CMAKE_CURRENT_SOURCE_DIR}/libconvert.a)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
install(TARGETS net DESTINATION "${FCITX_INSTALL_LIBDIR}/fcitx5")

# Addon config file
# We need additional layer of conversion because we want PROJECT_VERSION in it.
configure_file(net-addon.conf.in.in net-addon.conf.in)
fcitx5_translate_desktop_file("${CMAKE_CURRENT_BINARY_DIR}/net-addon.conf.in" net-addon.conf)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/net-addon.conf" RENAME net.conf DESTINATION "${FCITX_INSTALL_PKGDATADIR}/addon")

# Input Method registration file
fcitx5_translate_desktop_file(net.conf.in net.conf)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/net.conf" DESTINATION "${FCITX_INSTALL_PKGDATADIR}/inputmethod")
